﻿
CREATE PROCEDURE [dbo].[proc_Index_Loan_GetList]
	(
	@UserName nvarchar(50)
	)
AS
Begin
	
/*******************我的借款********************/	
		SELECT 
	  top 4
	   Convert(int,id) As Id     
      ,[lrrq] 
      ,[Summary],flag FROM Loan where ENameId=@UserName order by id desc
/*******************我的借款END********************/
	
	
/*******************我的报销********************/		
SELECT 
top 4 
	[id]	
	,[Summary]		
	,[lrrq]	
	,ISNULL([flag],0) as flag
FROM [L_Reimbursement]  where ENameId=@UserName order by id desc
/*******************我的报销END********************/	

/*******************我审批的借款********************/		
	SELECT 
	  top 4
	   Convert(int,id) As Id     
      ,[lrrq] 
      ,[Summary],flag FROM Loan where PZPerson=@UserName or SHPerson=@UserName order by id desc		
/*******************我审批的借款END********************/	

/*******************我审批的报销********************/
SELECT 
top 4 
	[id]	
	,[Summary]		
	,[lrrq]	
	,ISNULL([flag],0) as flag
FROM [L_Reimbursement]  where PZPerson=@UserName or SHPerson=@UserName order by id desc		
/*******************我审批的报销END********************/	
		
		
End



